package com.atguigu.jedis.demos;

import redis.clients.jedis.Jedis;

/**
 * Created by Smexy on 2022/5/20
 */
public class ConnectDemo {

    public static void main(String[] args) {

        //构建Jedisclient

        Jedis jedis = new Jedis("hadoop104", 6379);

        //写 set
        jedis.set("haha","xixi");

        //读 get
        String response = jedis.get("haha");

        //读一个不存在的key,返回值为null，不是""
        String response1 = jedis.get("afeaefaefa");

        System.out.println(response);
        System.out.println(response1);

        jedis.close();

    }
}
